const mongoose = require('../db')
const Schema = mongoose.Schema

const schema = new Schema({
  userid: { type: String, required: true },
  username: { type: String, required: false },
  nickname: { type: String, required: true },
  tel: { type: String, required: true },
  telcode: { type: String, required: true },
  password: { type: String, required: false },
  email: { type: String, required: false },
  sex: { type: Number, required: true },
  birthday: { type: String, required: false },
  avatar: { type: String, required: true }, // 头像
  regtime: { type: Date, required: true }
})

module.exports = mongoose.model('User', schema)